package com.ruoyi.iot.api;


import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.iot.api.domain.HealthDatas;
import com.ruoyi.iot.api.domain.HeathParam;
import com.ruoyi.iot.api.domain.PushInfo;
import com.ruoyi.iot.api.domain.WatchInfoVO;
import com.ruoyi.iot.api.factory.RemoteIotFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "remoteIotService", value = ServiceNameConstants.IOT_SERVICE, fallbackFactory = RemoteIotFallbackFactory.class)
public interface RemoteIotService {

    @GetMapping("/message/getLastMessageByCustomerId")
    R<WatchInfoVO> getLastMessageByCustomerIdDate(@RequestParam("customerId") Long customerId,@RequestParam("date") String date, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/message/addmockData")
    R<Boolean> addmockData(@RequestParam("customerId") Long customerId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/message/getHealthDataInner")
    R<HealthDatas> getHealthDataInner(@RequestBody HeathParam healthParam, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/push/pushHandler")
    R pushHandler(@RequestBody PushInfo pushInfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/message/getLastWeekHealthDataInner")
    R<HealthDatas> getLastWeekHealthDataInner(@RequestBody HeathParam healthParam, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/message/getLastMonthHealthDataInner")
    R<HealthDatas> getLastMonthHealthDataInner(@RequestBody HeathParam healthParam, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}


